/**
 * @author: Miss.杨
 * @date: 2025年3月09日 09:08:00
 * @description: 
 */
package com.sheepone.monitor.audit;

import com.sheepone.monitor.enums.SerializationAlgorithmsEnum;
import com.sheepone.monitor.enums.SheeponePackageTypeEnum;
import com.sheepone.monitor.handler.AbstractSheeponeContentInboundHandler;
import com.sheepone.monitor.proto.AuditLogMessageResponse;

import io.netty.channel.ChannelHandlerContext;

/**
 * @author: Miss.杨
 * @date: 2025年3月09日 09:08:00
 * @description:
 */
public class SheeponeAuditLogClientHandler extends AbstractSheeponeContentInboundHandler<AuditLogMessageResponse> {

    public SheeponeAuditLogClientHandler() {
        super(SheeponePackageTypeEnum.AUDIT_LOG_RESPONSE, SerializationAlgorithmsEnum.PROTOBUF);
    }

    @Override
    public AuditLogMessageResponse fromBytes(byte[] bytes, SerializationAlgorithmsEnum serialization) throws Exception {
        return AuditLogMessageResponse.parseFrom(bytes);
    }

    @Override
    protected void channelRead0(ChannelHandlerContext ctx, AuditLogMessageResponse msg) throws Exception {
        System.out.println(msg);
    }

}
